package home6;

import org.junit.Test;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class DEMO {


    @mytest
    public  void  soud(){
        System.out.println("woshi1");
    }
    public  void  soud1(){System.out.println("woshi2");
    }
    @mytest
    public  void  soud2(){System.out.println("woshi3");
    }
    public  void  soud3(){System.out.println("woshi4");
    }
    public  void  soud4(){System.out.println("woshi5");
    }

    @Test
    public void  s() throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
        Class<DEMO> demoClass = DEMO.class;
        DEMO demo = demoClass.getConstructor().newInstance();
        Method[] declaredMethods = demoClass.getDeclaredMethods();
        for (Method dd : declaredMethods) {
            dd.setAccessible(true);
            if(dd.isAnnotationPresent(mytest.class)){
                dd.invoke(demo);
            }

        }
    }
    }

